﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Administrador.Master" AutoEventWireup="true" CodeBehind="UI_NewModule.aspx.cs" Inherits="Espam.Idiomas.Decimo.Tesis.Web.UI_NewModule" EnableEventValidation="false" ViewStateEncryptionMode="Never" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="Stylesheet" type="text/css" />
      <style type="text/css">
        div.ui-datepicker {
            font-size: 80%;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Contenido" runat="server">    
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js" type="text/javascript"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    window.onload = function () {
        var seconds = 3;
        setTimeout(function () {
            document.getElementById("<%=lblvalida.ClientID %>").style.display = "none";
           }, seconds * 1000);
    };

        //Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
        //function EndRequestHandler(sender, args) {
        //    if (args.get_error() != undefined) {
        //        args.set_errorHandled(true);
        //    }
        //}
        //Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(Instanciar);
        //function Instanciar() {

        //    $.datepicker.setDefaults(options);
        //    $('.button').buttonset();
        //    $('.datepicker').datepicker();
        //}

        //var options = {
        //    showOn: "button",
        //    buttonImage: "Images/calendar.png",
        //    buttonImageOnly: true,
        //    buttonText: "Seleccione la fecha",
        //    dateFormat: "dd/MM/yy",
        //    showButtonPanel: true
        //};

        //$.datepicker._gotoToday = function (id) {
        //    var target = $(id);
        //    var inst = this._getInst(target[0]);
        //    if (this._get(inst, 'gotoCurrent') && inst.currentDay) {
        //        inst.selectedDay = inst.currentDay;
        //        inst.drawMonth = inst.selectedMonth = inst.currentMonth;
        //        inst.drawYear = inst.selectedYear = inst.currentYear;
        //    }
        //    else {
        //        var date = new Date();
        //        inst.selectedDay = date.getDate();
        //        inst.drawMonth = inst.selectedMonth = date.getMonth();
        //        inst.drawYear = inst.selectedYear = date.getFullYear();
        //        // the below two lines are new
        //        this._setDateDatepicker(target, date);
        //        this._selectDate(id, this._getDateDatepicker(target));
        //    }
        //    this._notifyChange(inst);
        //    this._adjustDate(target);
        //}

        //function CreaDatePicker(obj) {
        //    $('#' + obj).datepicker();
        //}


        //$(function () {
        //    $("[id$=txtFechaInicio]").datepicker({
        //        showAnim: 'shake',
        //        minDate : 0
        //        //showOn: 'button',
        //        //buttonImageOnly: true
        //        //buttonImage: im
        //    });
        //    });


        //$(function () {
        //    $("[id$=txtFechaFin]").datepicker({
        //        showAnim: 'shake',
        //        minDate: 0
        //    });
        //});
        //obtener la fecha con readonly 
        //string dt = Request.Form[txtDate.UniqueID];

        //$('#event_date').datepicker({
        //    showButtonPanel: true,
        //    dateFormat: "mm/dd/yy",
        //    beforeShow: function () {
        //        $(".ui-datepicker").css('font-size', 12)
        //    }
        //});


        $(function () {
            $("[id$=txtFechaInicio]").datepicker({
                defaultDate: "+1w",
                changeMonth: true,
                showAnim: 'shake',
                numberOfMonths: 1,
                dateFormat: 'yy/mm/dd',
                onClose: function (selectedDate) {
                    $("[id$=txtFechaFin]").datepicker("option", "minDate", selectedDate);
                }
            });
            $("[id$=txtFechaFin]").datepicker({
                defaultDate: "+1w",
                showAnim: 'shake',
                changeMonth: true,
                numberOfMonths: 1,
                dateFormat: 'yy/mm/dd',
                onClose: function (selectedDate) {
                    $("[id$=txtFechaInicio]").datepicker("option", "maxDate", selectedDate);
                }
            });
        }); 

</script>
   
       <cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </cc1:ToolkitScriptManager>
     <div id="page-wrapper">

            <div class="page-content">

                <!-- begin PAGE TITLE AREA -->
                <!-- Use this section for each page's title and breadcrumb layout. In this example a date range picker is included within the breadcrumb. -->
                <div class="row">
                    <div class="col-lg-12">
                        <div class="page-title">
                            <h1>M&oacute;dulos
                                <small>Nuevo M&oacute;dulo</small>
                            </h1>
                            <ol class="breadcrumb">
                                <li class="active">
                                 <asp:Label ID="lblvalida" runat="server" Text=""></asp:Label></li>
                                <li class="pull-right">
                                    <div id="reportrange" class="btn btn-green btn-square date-picker">
                                        <i class="fa fa-calendar"></i>
                                        <span class="date-range"></span> <i class="fa fa-caret-down"></i>
                                    </div>
                                </li>
                            </ol>
                        </div>
                    </div>
                    <!-- /.col-lg-12 -->
                </div>
                <!-- /.row -->
                <!-- end PAGE TITLE AREA -->

            </div>

          <!-- end PAGE TITLE ROW -->
          <!-- Standard Modal Trigger -->
                               
                <div class="row">
               <!-- Validation Examples -->
                    <div class="col-lg-12">
                        <div class="portlet portlet-default">
                            <div class="portlet-heading">
                                <div class="portlet-title">
                                    <h4>Datos Nuevo Módulo</h4>
                                </div>
                                <div class="portlet-widgets">
                                    <a data-toggle="collapse" data-parent="#accordion" href="#validationExamples"><i class="fa fa-chevron-down"></i></a>
                                </div>
                                <div class="clearfix"></div>
                            </div>
                            <div id="validationExamples" class="panel-collapse collapse in">
                                <div class="portlet-body">
                                   
                                <div class="portlet-body">
                                <div class="table-responsive">
                                    <table class="table">
                                        <thead>
                                            <tr>
                                                <td>Ciclo:</td>
                                                <td> <asp:TextBox ID="txtCiclo" autocomplete="off" runat="server" CssClass="form-control"  placeholder="Ingrese el numero de ciclo"></asp:TextBox>
                                                   <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" TargetControlID="txtCiclo" FilterType="Numbers"></cc1:FilteredTextBoxExtender>
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Campo Obligatorio" ControlToValidate="txtCiclo" ForeColor="Red" ToolTip="Ingrese el numero de ciclo" ></asp:RequiredFieldValidator>
                                                </td>
                                                <td>C&oacute;digo:</td>
                                                <td><asp:TextBox ID="txtCodigo" autocomplete="off"  runat="server" CssClass="form-control"  MaxLength="4" placeholder="ej. E102" ValidationGroup="modulo" Style="text-transform:uppercase" ></asp:TextBox> 
                                                    <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender2" runat="server"  FilterType="LowercaseLetters, Numbers, UppercaseLetters" TargetControlID="txtCodigo" ></cc1:FilteredTextBoxExtender>
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Campo Obligatorio" ControlToValidate="txtCodigo" ForeColor="Red"></asp:RequiredFieldValidator>
                                                </td>
                                               
                                            </tr>
                                        </thead>
                                        <tbody>
                                           <tr>
                                                <td>fecha Inicio:</td>
                                                <td>
                                                    <asp:TextBox ID="txtFechaInicio" placeholder="aaaa/mm/dd" autocomplete="off" runat="server" CssClass="form-control"  ValidationGroup="modulo"></asp:TextBox>                                          
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="Campo Obligarotio" ControlToValidate="txtFechaInicio" ForeColor="Red"></asp:RequiredFieldValidator>
                                                    <%--<cc1:CalendarExtender PopupButtonID="fInicio" TargetControlID="txtFechaInicio" runat="server" ID="CalendarFechaInicio" Format="yyyy/MM/dd">
                                                    </cc1:CalendarExtender>--%>
                                                    <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender3" runat="server"  FilterType="Numbers, Custom" ValidChars="/" TargetControlID="txtFechaInicio"></cc1:FilteredTextBoxExtender>
                                                
                                                </td>
                                                <td>Fecha Fin:</td>
                                                <td>
                                                    <asp:TextBox ID="txtFechaFin"  placeholder="aaaa/mm/dd" autocomplete="off" runat="server" CssClass="form-control"  ValidationGroup="modulo"></asp:TextBox>
                                                     <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="Campo Obligarotio" ControlToValidate="txtFechaFin" ForeColor="Red"></asp:RequiredFieldValidator>
                                                    <%--</form>--%>
                                                    <%--<cc1:CalendarExtender PopupButtonID="fFin" TargetControlID="txtFechaFin" runat="server" Format="yyyy/MM/dd"></cc1:CalendarExtender>--%>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>Horario</td>
                                                <td><asp:DropDownList ID="cmbListadoHorarios" runat="server" CssClass="form-control"></asp:DropDownList></td>
                                                <td>Ubicaci&oacute;n</td>
                                                <td><asp:DropDownList ID="cmbUbicacion" runat="server" CssClass="form-control"></asp:DropDownList></td>
                                                
                                            </tr>
                                            <tr>
                                                <td>Docente</td>
                                                <td><asp:DropDownList ID="cmbDocentes" runat="server" CssClass="form-control"></asp:DropDownList></td>
                                                <td>Vacacional:<br />
                                                    Especial:</td>
                                                <td> <asp:CheckBox ID="chkVacacional" runat="server" />
                                                    <br />
                                                    <asp:CheckBox ID="chkEpecial" runat="server" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    
                                                </td>
                                                <td></td>
                                                <td><asp:Button ID="btnCancelar" runat="server" Text="Cancelar" Visible="false" CssClass="btn btn-block" OnClick="btnCancelar_Click" /></td>
                                                <td>
                                                    
                                                    <asp:Button ID="btnGuardarModulo" runat="server" Text="Guardar Módulo" CssClass="btn btn-dark-blue" OnClick="btnGuardarModulo_Click"/></td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                                    <%--<asp:GridView ID="gvHorarios" Width="100%" runat="server" AutoGenerateColumns="False" BackColor="#CCCCCC" BorderColor="#999999" BorderStyle="Solid" BorderWidth="3px" CellPadding="4" CellSpacing="2" ForeColor="Black" OnRowCommand="gvHorarios_RowCommand" >
                                        <Columns>
                                            <asp:BoundField DataField="horariogrid" HeaderText="Horarios" />
                                            <asp:TemplateField HeaderText="Modulos">
                                                <ItemTemplate>
                                                    <asp:GridView ID="gvModulos" Width="100%" runat="server" AutoGenerateColumns="False" BackColor="#CCCCCC" BorderColor="#999999" BorderStyle="Solid" BorderWidth="3px" CellPadding="4" CellSpacing="2" DataSource='<%# Bind("Modulosgrid") %>' ForeColor="Black" OnRowCommand="gvModulos_RowCommand" >
                                                        <Columns>
                                                            <asp:BoundField DataField="codigoModulo" HeaderText="Modulo" />
                                                            <asp:BoundField DataField="ubicacion" HeaderText="Ubicacion" />
                                                            <asp:BoundField DataField="docente" HeaderText="Docente" />
                                                            <asp:CommandField ShowSelectButton="True" />
                                                        </Columns>
                                                        <FooterStyle BackColor="#CCCCCC" />
                                                        <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                                                        <PagerStyle BackColor="#CCCCCC" ForeColor="Black" HorizontalAlign="Left" />
                                                        <RowStyle BackColor="White" />
                                                        <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
                                                        <SortedAscendingCellStyle BackColor="#F1F1F1" />
                                                        <SortedAscendingHeaderStyle BackColor="Gray" />
                                                        <SortedDescendingCellStyle BackColor="#CAC9C9" />
                                                        <SortedDescendingHeaderStyle BackColor="#383838" />
                                                    </asp:GridView>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                        </Columns>
                                        <FooterStyle BackColor="#CCCCCC" />
                                        <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                                        <PagerStyle BackColor="#CCCCCC" ForeColor="Black" HorizontalAlign="Left" />
                                        <RowStyle BackColor="White" />
                                        <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
                                        <SortedAscendingCellStyle BackColor="#F1F1F1" />
                                        <SortedAscendingHeaderStyle BackColor="Gray" />
                                        <SortedDescendingCellStyle BackColor="#CAC9C9" />
                                        <SortedDescendingHeaderStyle BackColor="#383838" />
                               </asp:GridView>--%>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- /.col-lg-12 -->
                    <!-- End Validation Examples -->
             </div>

                <!-- /.row -->
         <div class="row">
               <!-- Validation Examples -->
                    <div class="col-lg-12">
                        <div class="portlet portlet-default">
                            <div class="portlet-heading">
                                <div class="portlet-title">
                                    <h4>Lista de Módulos</h4>
                                </div>
                                <div class="clearfix"></div>
                            </div>
                            <div id="Div1" class="panel-collapse collapse in">
                                <div class="portlet-body" >
                                   
                                <div class="portlet-body">
                                     
                                     <div class="table-responsive">
                                     <table class="table">
                               <%-- </div>--%>
                                  <!-- gridview modulos -->

                                  <!-- End gridview modulos -->
                                    <%--</form>--%> 
                                    <asp:GridView ID="GridView1" Width="100%" runat="server" 
                                        AutoGenerateColumns="False" CellPadding="4" GridLines="Horizontal" DataKeyNames="idModulo" 
                                        OnSelectedIndexChanged="GridView1_SelectedIndexChanged" BackColor="White" BorderColor="#336666" 
                                        BorderStyle="Double" BorderWidth="3px"
                                         OnRowDeleting="GridView1_RowDeleting" OnLoad="GridView1_Load" OnPreRender="GridView1_PreRender">
                                        <Columns>
                                            <asp:BoundField DataField="horario" HeaderText="HORARIO" >
                                            <HeaderStyle HorizontalAlign="Center" />
                                            </asp:BoundField>
                                            <asp:BoundField DataField="codigo" HeaderText="CODIGO" >
                                            <HeaderStyle HorizontalAlign="Center" />
                                            </asp:BoundField>
                                            <asp:BoundField DataField="ubicacion" HeaderText="UBICACION" >
                                            <HeaderStyle HorizontalAlign="Center" />
                                            </asp:BoundField>
                                            <asp:BoundField DataField="docente" HeaderText="DOCENTE" >
                                            <HeaderStyle HorizontalAlign="Center"/>
                                            </asp:BoundField>
                                            <asp:CommandField ShowSelectButton="True" ButtonType="Image" SelectImageUrl="~/Images/1415847473_file_edit.png" />
                                            <%--<asp:CommandField ShowDeleteButton="True" ButtonType="Image" DeleteImageUrl="~/Images/1417092348_file_delete.png"  Visible="false" />--%>
                                        </Columns>
                                    </asp:GridView>
                                         </table>
                            </div>
                                    </div>
                                         <%--</form>--%>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- /.col-lg-12 -->
                    <!-- End Validation Examples -->
             </div>
                <!-- /.row -->
     </div>
</asp:Content>
